from rest_framework import viewsets, status
from rest_framework.response import Response
from nlp_taskflow.nlp import NLP
from django.views import View
from django.http import HttpResponse

# Create your views here.

# nlp_mode = NLP()

class ImgView(View):
    def post(self, request):
        res_data = {}
        if 'text' in request.GET.keys():
            text = request.GET['text']
            # res = nlp_mode.img(text)
            return HttpResponse(text)
        else:
            res_data['message'] = '输入为空'
            return HttpResponse(res_data, status=200)
    

